package com.szbber.medical.board.viewModel

import android.content.Context
import androidx.lifecycle.MutableLiveData
import com.szbber.commen.api.Repository
import com.szbber.commen.api.launch
import com.szbber.commen.base.BaseViewModel
import com.szbber.commen.bean.PatientListBean
import com.szbber.commen.utils.DataStoreUtil
import com.szbber.commen.utils.dataStoreRead

class PatientInfoViewModel : BaseViewModel() {

    val patientListBean = MutableLiveData<PatientListBean>()

    fun getPatientList(context: Context?) = launch(context, {
        val deptCode = dataStoreRead<String>("deptCode")
        val queue = arrayOf("deptCode", deptCode)
        patientListBean.value = Repository.getPatientList(context, *queue)
    })
}